﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Shared.xaml" />
  </ResourceDictionary.MergedDictionaries>
    <!-- TABCONTROL: Style -->
    <Style x:Key="GlassTabControl"  TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel
                          Name="HeaderPanel"
                          Grid.Column="0"
                          Panel.ZIndex="1"
                          Margin="0,0,0,0"
                          IsItemsHost="True"
                          KeyboardNavigation.TabIndex="1"
                          Background="Transparent" />
                        <Border
                          Name="Border"
                          Grid.Column="1"
                          Background="white"
                          BorderBrush="lightgray"
                          BorderThickness="1"
                          CornerRadius="2"
                          KeyboardNavigation.TabNavigation="Local"
                          KeyboardNavigation.DirectionalNavigation="Contained"
                          KeyboardNavigation.TabIndex="2" >
                            <ContentPresenter
                              Name="PART_SelectedContentHost"
                              Margin="4"
                              ContentSource="SelectedContent" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="red" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="blue" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="GlassTabControl2"  TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel
                          Name="HeaderPanel"
                          Grid.Column="0"
                          Panel.ZIndex="1"
                          Margin="0,0,0,0"
                          IsItemsHost="True"
                          KeyboardNavigation.TabIndex="1"
                          Background="Transparent" />
                        <Border
                          Name="Border"
                          Grid.Column="1"
                          Background="Transparent"
                          BorderBrush="Transparent"
                          BorderThickness="1"
                         
                          KeyboardNavigation.TabNavigation="Local"
                          KeyboardNavigation.DirectionalNavigation="Contained"
                          KeyboardNavigation.TabIndex="2" >
                            <ContentPresenter
                              Name="PART_SelectedContentHost"
                              Margin="1"
                              ContentSource="SelectedContent" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="red" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="blue" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- TAB ITEM: Brushes -->
    <LinearGradientBrush x:Key="TabItemBrush_Off" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FFFFFFFF" Offset="0.435"/>
        <GradientStop Color="#FFE0E1E3" Offset="0.669"/>
    </LinearGradientBrush>

    <!-- TAB ITEM: Style-->
    <Style  TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border
                          Name="Border"
                          Margin="4,0,0,0"
                          Background="{StaticResource TabItemBrush_Off}"
                          BorderBrush="Gray"
                          BorderThickness="2"
                          CornerRadius="5,0,0,5" >
                            <ContentPresenter x:Name="ContentSite"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center"
                              ContentSource="Header"
                              Margin="12,2,12,2"
                              RecognizesAccessKey="True"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Background" Value="White" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1,1,0,1" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="lightgray" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="orange" />
                            <Setter Property="Foreground" Value="royalblue" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <!--</SnippetTabControl>-->
</ResourceDictionary>
